<template>
  <div>
    <input type="text" v-model="numberValue" placeholder="请输入数字" />
    <div style="margin-top: 20px" v-if="numberValue">
      数字{{ numberValue }}的2倍是{{ doubleValue }}
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      numberValue: null,
    };
  },
  computed: {
    doubleValue() {
      return this.numberValue ? this.numberValue * 2 : "";
    },
  },
};
</script>
